package main

import (
	"context"
	"fmt"
	"net/http"
	"time"
)

func main() {
	req, err := http.NewRequest("get", "https://eddycjy.com/", nil)
	if err != nil {
		fmt.Printf("http.newRequest err: %+v", err)
		return
	}
	ctx, cancel := context.WithTimeout(req.Context(), 50 * time.Millisecond)
	defer cancel()
	req = req.WithContext(ctx)
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		fmt.Printf("http.defaultclient.do err : %+v", err)
		return
	}
	defer resp.Body.Close()

}
